﻿@model  WaiGaoQiaoWeb.Models.DepartMentVM
@{
    ViewBag.Title = "DepartmentEdit";
}
@section Head
{
    @Html.Css("form", "validationEngine")
    @Html.Js("form", "validate", "unobtrusive", "inlinevalidation")
    <script type="text/javascript">
        $(document).ready(function () {

            $("#DepartmentEdit").makeValidationInline();

            //保存
            $("#btnSave").click(function (event) {
                if (!$("#DepartmentEdit").valid()) {
                    return false;
                }

                $('#DepartmentEdit').ajaxSubmit(function (callback) {
                    if (callback) {
                        CloseModelWindow(null, true);
                    }
                    else {
                        showErrorTip("操作失败！", { left: 200, top: 2 }, true, 5000);
                    }
                });

            });
            //关闭
            $("#btnCancel").click(function (e) {
                //var users = "我来自上一页，请多关照！";
                CloseModelWindow(null, false);
            });

        })
    </script>
}
<div style="padding: 5px;">
    @using (Html.BeginForm("SaveDepartMent", "DepartMent", FormMethod.Post, new { id = "DepartmentEdit" }))
    {
        @Html.ValidationSummary(true)
        <div class="mainpanel">
            <div style="height: 10px">
            </div>
            <div>
                @Html.HiddenFor(model => model.Dep_ID)
            </div>
            <div style="height: 10px">
            </div>
            <div>
                @Html.LabelFor(model => model.Dep_No):
                @Html.TextBoxFor(model => model.Dep_No, new { @class = "" })<b style="color: Red">*</b>
                @Html.ValidationMessageFor(model => model.Dep_No)
            </div>
            <div style="height: 10px">
            </div>
            <div>
                @Html.LabelFor(model => model.DeptName):
                @Html.TextBoxFor(model => model.DeptName, new { @class = "" }) <b style="color: Red">
                    *</b>
                @Html.ValidationMessageFor(model => model.DeptName)
            </div>
        </div>
        @Html.HiddenFor(model => model.PriorNo)
    }
    <div class="buttonpanel">
        <div style="float: right; margin-right: 10px;">
            <a id="btnSave" class="button" href="javascript:void(0);"><span>保存</span></a> <a
                id="btnCancel" class="button" href="javascript:void(0);"><span>关闭</span></a>
        </div>
    </div>
